Virtual pitot refactor + other pitot improvements - #11668
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Test firmware build ready — commit Download firmware for PR #11668 243 targets built. Find your board's
|
|
@error414 Have you tested this with a real pitot by any chance ? Would be useful to double check this works with actual hardware before merging. |
|
@breadoven I'm on vacation now, I will return next week, I will be able to test it from 13.8. If you would like I will add this PR to my test FW. |
|
@error414 It would be useful if you could test this. The Virtual pitot stuff works fine in HITL and I tested as far as I could using the Fake pitot but the only real way of double checking actual hardware pitot is with hardware ... that I don't have. |
Simplifies virtual pitot by removing current driver style implementation and instead runs it as a simple function. The benefit is simplified logic and removal of essentially unnecessary and repetitive code. It also avoids the illogical conversion from airspeed to pressure than back to airspeed which makes little sense when virtual pitot provides airspeed directly from GPS and wind estimates.
PR also includes changes to the pitot protothread to simplify implementation of Fake pitot and Simulator pitot. This removes conversions to pressure and instead uses the Fake pitot and Simulated airspeed directly. This involves moving
ptYield()to the end of the thread rather than have it in the middle. It's not clear why it was placed in the middle originally other than possibly to avoid time delta issues for filtering on the first iteration. Moving it doesn't seem to affect how the Virtual pitot works as currently implemented (as a driver) when tested in HITL. However, the real test will be with pitot hardware which hasn't been tested (don't have one). Pressure based airspeed calculations are skipped if Fake or Simulated airspeeds are used.Virtual airspeed is based on the Virtual pitot driver logic using -> wind estimated airspeed falling back to -> GPS 3D speed if no wind estimate and finally ->
fixedWingReferenceAirspeedif no GPS available. Not sure about usingfixedWingReferenceAirspeed, it may be better to only use this for a Virtual pitot and otherwise use 0.HITL testing shows the Virtual pitot works as expected as do HITL pitot functions, i.e. pitot simulation and pitot failure. Still needs fully testing properly with actual pitot hardware.